home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / perl5000.zip / perl5000 / cflags.SH < prev    next >
Text File  |  1994-10-17  |  3KB  |  133 lines

  1. case $CONFIG in
  2. '')
  3.     if test -f config.sh; then TOP=.;
  4.     elif test -f ../config.sh; then TOP=..;
  5.     elif test -f ../../config.sh; then TOP=../..;
  6.     elif test -f ../../../config.sh; then TOP=../../..;
  7.     elif test -f ../../../../config.sh; then TOP=../../../..;
  8.     else
  9.         echo "Can't find config.sh."; exit 1
  10.     fi
  11.     . $TOP/config.sh
  12.     ;;
  13. esac
  14. : This forces SH files to create target in same directory as SH file.
  15. : This is so that make depend always knows where to find SH derivatives.
  16. case "$0" in
  17. */*) cd `expr X$0 : 'X\(.*\)/'` ;;
  18. esac
  19. echo "Extracting cflags (with variable substitutions)"
  20. : This section of the file will have variable substitutions done on it.
  21. : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
  22. : Protect any dollar signs and backticks that you do not want interpreted
  23. : by putting a backslash in front.  You may delete these comments.
  24. $spitshell >cflags <<!GROK!THIS!
  25. !GROK!THIS!
  26.  
  27. : In the following dollars and backticks do not need the extra backslash.
  28. $spitshell >>cflags <<'!NO!SUBS!'
  29. case $CONFIG in
  30. '')
  31.     if test -f config.sh; then TOP=.;
  32.     elif test -f ../config.sh; then TOP=..;
  33.     elif test -f ../../config.sh; then TOP=../..;
  34.     elif test -f ../../../config.sh; then TOP=../../..;
  35.     elif test -f ../../../../config.sh; then TOP=../../../..;
  36.     else
  37.         echo "Can't find config.sh."; exit 1
  38.     fi
  39.     . $TOP/config.sh
  40.     ;;
  41. esac
  42.  
  43. perltype=''
  44. optdebug=''    # ensure -g used if building a -DDEBUGGING libperl
  45. case $# in
  46. 2) case $1 in
  47.     *perl.*)    perltype='';;
  48.     *perld.*)   perltype='-DDEBUGGING'; optdebug='-g' ;;
  49.     *perle.*)   perltype='-DEMBED';;
  50.     *perlde.*)  perltype='-DDEBUGGING -DEMBED'; optdebug='-g' ;;
  51.     *perlm.*)   perltype='-DEMBED -DMULTIPLICITY';;
  52.     *perldm.*)  perltype='-DDEBUGGING -DEMBED -DMULTIPLICITY'; optdebug='-g' ;;
  53.     esac
  54.     shift ;;
  55. esac
  56.  
  57. also=': '
  58. case $# in
  59. 1) also='echo 1>&2 "      CCCMD = "'
  60. esac
  61.  
  62. case $# in
  63. 0) set *.c; echo "The current C flags are:" ;;
  64. esac
  65.  
  66. set `echo "$* " | sed 's/\.[oc] / /g'`
  67.  
  68. for file do
  69.  
  70.     case "$#" in
  71.     1) ;;
  72.     *) echo $n "    $file.c    $c" ;;
  73.     esac
  74.  
  75.     : allow variables like toke_cflags to be evaluated
  76.  
  77.     eval 'eval ${'"${file}_cflags"'-""}'
  78.  
  79.     : or customize here
  80.  
  81.     case "$file" in
  82.     DB_File) ;;
  83.     GDBM_File) ;;
  84.     NDBM_File) ;;
  85.     ODBM_File) ;;
  86.     POSIX) ;;
  87.     SDBM_File) ;;
  88.     av) ;;
  89.     deb) ;;
  90.     dl) ;;
  91.     doio) ;;
  92.     doop) ;;
  93.     dump) ;;
  94.     gv) ;;
  95.     hv) ;;
  96.     main) ;;
  97.     malloc) ;;
  98.     mg) ;;
  99.     miniperlmain) ;;
  100.     op) ;;
  101.     perl) ;;
  102.     perlmain) ;;
  103.     perly) ;;
  104.     pp) ;;
  105.     pp_ctl) ;;
  106.     pp_hot) ;;
  107.     pp_sys) ;;
  108.     regcomp) ;;
  109.     regexec) ;;
  110.     run) ;;
  111.     scope) ;;
  112.     sv) ;;
  113.     taint) ;;
  114.     toke) ;;
  115.     usersub) ;;
  116.     util) ;;
  117.     *) ;;
  118.     esac
  119.  
  120.     if test "X$optdebug" != "X"; then
  121.         optimize="$optdebug"
  122.     fi
  123.  
  124.     echo "$cc -c $ccflags $optimize $perltype $large $split"
  125.     eval "$also "'"$cc -c $ccflags $optimize $perltype $large $split"'
  126.  
  127.     . $TOP/config.sh
  128.  
  129. done
  130. !NO!SUBS!
  131. chmod 755 cflags
  132. $eunicefix cflags
  133.